package tech.yangzhijie.basic.simpleFactory;

import org.junit.Test;

public class Tests {
    /** 不使用工厂模式 */
    @Test
    public void method01(){
        Car c1 = new Aodi();
        Car c2 = new Benchi();

        c1.run();
        c2.run();
    }

    /** 使用工厂模式 */
    @Test
    public void method02(){
        Car c1 = CarFactory.createCar("奥迪");
        Car c2 = CarFactory.createCar("奔驰");

        c1.run();
        c2.run();
    }
}
